1 <?php
2 session_start();
// Use session variable on this page. This function must put on the top of page.
3 if
(!isset($_SESSION['username']) || $_SESSION['usertype'] !='admin'){ // if session variable "username" does not exist.
4 header(
"location:index.php?msg=Please%20login%20to%20access%20admin%20area%20!"); // Re-direct to index.php
5 }

6 else

7 {
8     include_once
"db.php";
9     error_reporting (E_ALL ^ E_NOTICE);
10
11 ?><!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01 Transitional//EN"
12 "http:
//www.w3.org/TR/html4/loose.dtd">
13 <html>
14 <head>
15 <title>Welcome to Stock Management System !</title>
16 <meta http-equiv=
"Content-Type" content="text/html; charset=iso-8859-1">
17 <link rel=
"stylesheet" href="css/validationEngine.jquery.css" type="text/css" media="screen" title="no title" charset="utf-8" />
18         <link rel=
"stylesheet" href="css/template.css" type="text/css" media="screen" title="no title" charset="utf-8" />
19         <script src=
"js/jquery.min.js" type="text/javascript"></script>
20         
21
22
23         <script src=
"js/jquery.validationEngine-en.js" type="text/javascript"></script>
24         <script src=
"js/jquery.validationEngine.js" type="text/javascript"></script>
25          <script src=
"js/jquery.hotkeys-0.7.9.js"></script>
26         <!-- AJAX SUCCESS TEST FONCTION
27             <script>function callSuccessFunction(){alert(
"success executed")}
28                     function callFailFunction(){alert(
"fail executed")}
29             </script>
30         -->
31         
32         <script>
33         
34         
35         
36         
37         
38         $(document).ready(function() {
39             
// SUCCESS AJAX CALL, replace "success: false," by: success : function() { callSuccessFunction() },
40              $(
"#name").focus();
41             $(
"#form1").validationEngine(),
42             
43             jQuery(document).bind(
'keydown', 'Ctrl+s',function() {
44           $(
'#form1').submit();
45           
return false;
46             });
47             
48             jQuery(document).bind(
'keydown', 'Ctrl+r',function() {
49           $(
'#form1').reset();
50           
return false;
51             });
52             jQuery(document).bind(
'keydown', 'Ctrl+a',function() {
53             window.location =
"add_supplier_details.php";
54           
return false;
55             });
56             jQuery(document).bind(
'keydown', 'Ctrl+0',function() {
57             window.location =
"admin.php";
58           
return false;
59             });
60             jQuery(document).bind(
'keydown', 'Ctrl+1',function() {
61             window.location =
"add_purchase.php";
62               
return false;
63             });
64             jQuery(document).bind(
'keydown', 'Ctrl+2',function() {
65             window.location =
"add_stock_sales.php";
66               
return false;
67             });
68             jQuery(document).bind(
'keydown', 'Ctrl+3',function() {
69             window.location =
"add_stock_details.php";
70               
return false;
71             });
72             jQuery(document).bind(
'keydown', 'Ctrl+4',function() {
73             window.location =
"add_category.php";
74               
return false;
75             });
76             jQuery(document).bind(
'keydown', 'Ctrl+5',function() {
77             window.location =
"add_supplier_details.php";
78               
return false;
79             });
80             jQuery(document).bind(
'keydown', 'Ctrl+6',function() {
81             window.location =
"add_customer_details.php";
82               
return false;
83             });
84             jQuery(document).bind(
'keydown', 'Ctrl+7',function() {
85             window.location =
"view_stock_entries.php";
86               
return false;
87             });
88             jQuery(document).bind(
'keydown', 'Ctrl+8',function() {
89             window.location =
"view_stock_sales.php";
90               
return false;
91             });
92             jQuery(document).bind(
'keydown', 'Ctrl+9',function() {
93             window.location =
"view_stock_details.php";
94               
return false;
95             });
96             
//$.validationEngine.loadValidation("#date")
97             
//alert($("#formID").validationEngine({returnIsValid:true}))
98             
//$.validationEngine.buildPrompt("#date","This is an example","error") // Exterior prompt build example // input prompt close example
99             
//$.validationEngine.closePrompt(".formError",true) // CLOSE ALL OPEN PROMPTS
100         });
101     </script>
102 <style type=
"text/css">
103 <!--
104 body {
105     margin-left: 0px;
106     margin-top: 0px;
107     margin-right: 0px;
108     margin-bottom: 0px;
109     background-color: #FFFFFF;
110 }
111
112 *{
113 padding: 0px;
114 margin: 0px;
115 }
116 #vertmenu {
117 font-family: Verdana, Arial, Helvetica, sans-serif;
118 font-size:
100%;
119 width: 160px;
120 padding: 0px;
121 margin: 0px;
122 }
123
124 #vertmenu h1 {
125 display: block;
126 background-color:#FF9900;
127 font-size:
90%;
128 padding: 3px
0 5px 3px;
129 border: 1px solid #
000000;
130 color: #
333333;
131 margin: 0px;
132 width:159px;
133 }
134
135 #vertmenu ul {
136 list-style: none;
137 margin: 0px;
138 padding: 0px;
139 border: none;
140 }
141 #vertmenu ul li {
142 margin: 0px;
143 padding: 0px;
144 }
145 #vertmenu ul li a {
146 font-size:
80%;
147 display: block;
148 border-bottom: 1px dashed #C39C4E;
149 padding: 5px 0px 2px 4px;
150 text-decoration: none;
151 color: #
666666;
152 width:160px;
153 }
154
155 #vertmenu ul li a:hover, #vertmenu ul li a:focus {
156 color: #
000000;
157 background-color: #eeeeee;
158 }
159 .style1 {color: #
000000}
160
161 -->
162 </style>
163 </head>
164
165 <body>
166 <table width=
"100%" border="0" cellspacing="0" cellpadding="0">
167   <tr>
168     <td align=
"center" valign="top"><table width="960" border="0" cellspacing="0" cellpadding="0">
169       <tr>
170         <td><table width=
"960" border="0" cellpadding="0" cellspacing="0" bgcolor="#ECECEC">
171           <tr>
172             <td height=
"90" align="left" valign="top"><img src="images/topbanner.jpg" width="960" height="82"></td>
173           </tr>
174           <tr>
175             <td height=
"800" align="left" valign="top"><table width="960" border="0" cellpadding="0" cellspacing="0" bgcolor="#ECECEC">
176               <tr>
177                 <td width=
"130" align="left" valign="top">
178                 
179                 <br>
180
181                 <strong>Welcome <font color=
"#3399FF"><?php echo $_SESSION['username']; ?> !</font></strong><br> <br>
182 <table width=
"100%" border="0" cellspacing="0" cellpadding="0">
183                   <tr>
184                     <td align=
"center"><a href="admin.php"><img src="images/home.png" width="130" height="99" border="0"></a></td>
185                   </tr>
186                   <tr>
187                     <td align=
"center">&nbsp;</td>
188                   </tr>
189                   <tr>
190                     <td align=
"center"><a href="add_purchase.php"><img src="images/purchase.png" width="130" height="124" border="0"></a></td>
191                   </tr>
192                   <tr>
193                     <td align=
"center">&nbsp;</td>
194                   </tr>
195                   <tr>
196                     <td align=
"center"><a href="add_stock_sales.php"><img src="images/sales.png" width="146" height="111" border="0"></a></td>
197                   </tr>
198                   <tr>
199                     <td align=
"center">&nbsp;</td>
200                   </tr>
201                   <tr>
202                     <td align=
"center"><a href="report.php"><img src="images/reports.png" width="131" height="142" border="0"></a></td>
203                   </tr>
204                   <tr>
205                     <td align=
"center">&nbsp;</td>
206                   </tr>
207                   <tr>
208                     <td align=
"center">&nbsp;</td>
209                   </tr>
210                   <tr>
211                     <td align=
"center">&nbsp;</td>
212                   </tr>
213                 </table> <br>
214
215
216     
217                 
218                 
219                 </td> <td height=
"500" align="center" valign="top">
220 <table width=
"100%" border="0" cellspacing="0" cellpadding="0">
221   <tr>
222     <td><a href=
"add_stock_details.php"><img src="images/addstockdetails.png" width="67" height="62" border="0"></a></td>
223     <td><a href=
"add_supplier_details.php"><img src="images/supplier.png" width="67" height="54" border="0"></a></td>
224     <td><a href=
"add_customer_details.php"><img src="images/customer.png" width="67" height="54" border="0"></a></td>
225     <td><a href=
"add_category.php"><img src="images/categories.png" width="67" height="54" border="0"></a></td>
226     <td><a href=
"view_stock_sales.php"><img src="images/vsales.png" width="67" height="54" border="0"></a></td>
227     <td><a href=
"view_stock_entries.php"><img src="images/vpurchase.png" width="67" height="54" border="0"></a></td>
228     <td><a href=
"view_stock_details.php"><img src="images/stockdetails.png" width="67" height="54" border="0"></a></td>
229     <td><a href=
"view_stock_availability.php"><img src="images/savail.png" width="67" height="54" border="0"></a></td>
230      <td align=
"left" valign="top"><a href="view_customer_details.php"><img src="images/customers.png" width="94" height="22" border="0"></a><br> <a href="view_supplier_details.php"><img src="images/suppliers.png" width="94" height="22" border="0"></a><br>
231       <a href=
"view_payments.php"><img src="images/payments.png" width="94" height="22" border="0"></a></td>
232     <td align=
"left" valign="top"><a href="view_stock_sales_payments.php"><img src="images/outstanding.png" width="94" height="22" border="0"></a><br> <a href="view_stock_entries_payments.php"><img src="images/pendings.png" width="94" height="22" border="0"></a><br>
233       <a href=
"logout.php"><img src="images/logout.png" width="94" height="22" border="0"></a></td>
234   </tr>
235 </table>
236 <?php
237                 
if(isset($_POST['name']))
238
239             {
240             
241             
242             $name=mysql_real_escape_string($_POST[
'name']);
243             $address=mysql_real_escape_string($_POST[
'address']);
244             $contact1=mysql_real_escape_string($_POST[
'contact1']);
245             $contact2=mysql_real_escape_string($_POST[
'contact2']);
246             
247             $count = $db->countOf(
"customer_details", "customer_name='$name'");
248         
if($count==1)
249             {
250         echo
"<font color=red> Dublicat Entry. Please Verify</font>";
251             }
252             
else
253             {
254                 
255             
if($db->query("insert into supplier_details values(NULL,'$name','$address','$contact1','$contact2',0)"))
256             echo
"<br><font color=green size=+1 > [ $name ] Supplier Details Added !</font>" ;
257             
else
258             echo
"<br><font color=red size=+1 >Problem in Adding !</font>" ;
259             
260             }
261             
262             
263             }
264                 
265                 ?>
266                 
267                 <br>
268 <br>
269
270                 
271                 <form name=
"form1" method="post" id="form1" action="">
272                   
273                   <p align=
"center"><strong>Add Suplier Details </strong> - Add New ( Control +A)</p>
274                   <table width=
"300" border="0" cellspacing="0" cellpadding="0">
275                     <tr>
276                       <td width=
"150">&nbsp;</td>
277                       <td width=
"150">&nbsp;</td>
278                     </tr>
279                     <tr>
280                       <td width=
"150">&nbsp;</td>
281                       <td width=
"150">&nbsp;</td>
282                     </tr>
283                     <tr>
284                       <td width=
"150">&nbsp;</td>
285                       <td width=
"150">&nbsp;</td>
286                     </tr>
287                     <tr>
288                       <td width=
"150">Name:</td>
289                       <td width=
"150"><input name="name" type="text" id="name" class="validate[required,length[0,100]] text-input"></td>
290                     </tr>
291                     <tr>
292                       <td width=
"150">&nbsp;</td>
293                       <td width=
"150">&nbsp;</td>
294                     </tr>
295                     <tr>
296                       <td width=
"150">Address</td>
297                       <td width=
"150"><textarea name="address" cols="15"></textarea></td>
298                     </tr>
299                     <tr>
300                       <td>&nbsp;</td>
301                       <td>&nbsp;</td>
302                     </tr>
303                     <tr>
304                       <td>Contact
1 </td>
305                       <td><input name=
"contact1" type="text" id="buyingrate" class="validate[optional,custom[onlyNumber],length[6,15]] text-input" ></td>
306                     </tr>
307                     <tr>
308                       <td>&nbsp;</td>
309                       <td>&nbsp;</td>
310                     </tr>
311                     <tr>
312                       <td>Contact
2 </td>
313                       <td><input name=
"contact2" type="text" id="sellingrate" class="validate[optional,custom[onlyNumber],length[6,15]] text-input" ></td>
314                     </tr>
315                     <tr>
316                       <td>&nbsp;</td>
317                       <td>&nbsp;</td>
318                     </tr>
319                     <tr>
320                       <td align=
"right"><input type="reset" name="Reset" value="Reset"> &nbsp;&nbsp;&nbsp;</td>
321                       <td> &nbsp;&nbsp;&nbsp;
322                         <input type=
"submit" name="Submit" value="Save"></td>
323                     </tr>
324                     <tr>
325                       <td align=
"center">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(Control + R) </td>
326                       <td align=
"left"> &nbsp;&nbsp;( Control + S ) </td>
327                     </tr>
328                   </table>
329                 </form>
330                 <br>
331 <br>
332
333                 </td>
334               </tr>
335             </table>
336             
337         </td>
338           </tr>
339           <tr>
340             <td height=
"30" align="center" bgcolor="#72C9F4"><span class="style1"><a href="http://www.pluskb.com">Developed by PlusKB Innovations</a></span></td>
341           </tr>
342         </table></td>
343       </tr>
344     </table></td>
345   </tr>
346 </table>
347
348 </body>
349 </html>
350 <?php
351 }
352 ?>


Gõ tìm kiếm nhanh...